package client.based.location.lbs.network;

import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;

import org.json.JSONObject;

/**
 * Created by Developer on 12/12/2015.
 */
public class JsonRequestClass {

    private ResponseListner mListner;
    private String mJString;
    private FragmentActivity mFragment;
    public JsonRequestClass(ResponseListner responseListner)
    {
      this.mListner=responseListner;


    }
    public void makerequest( FragmentActivity mFragment,String mJString)
    {
        this.mFragment=mFragment;
        this.mJString=mJString;
        new RequestJson().execute();

    }

public class RequestJson extends AsyncTask<String, String, String>
{
    @Override
    protected void onPreExecute()
    {
        // TODO Auto-generated method stub
        super.onPreExecute();


    }

    @Override
    protected String doInBackground(String... params)
    {
        // TODO Auto-generated method stub
        JSONObject lResponse = JSONfunctions.getJSONfromURL("http://ecg.zoneabc.com/test_login.php?tag=login&email=shinde1@gmail.com&password=12345");//HMACClient.makeHTTPCallUsingHMAC(mJString);

        return lResponse.toString()







                ;
    }



    @Override
    protected void onPostExecute(String result)
    {
        // TODO Auto-generated method stub
        super.onPostExecute(result);
        try
        {

            if (result != null)
            {
                mListner.onGetResponse(result);
            } else
            {
              //  mAlertPeopleHR.onShowAlertDialog(mFragment,mFragment.getString(R.string.alert_server_error));
            }
        } catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }



    }

}}